package com.fagejiang.web.controllers;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * TODO
 *
 * @author 发哥讲Java
 * @version 1.0
 * @date 2021-05-18 16:31
 */
@RestController
@RequestMapping("/web")
public class GetController {

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/hello")
    public String hello(@RequestHeader Map<String, String> headers) {
        headers.forEach((k, v) -> {
            System.out.println("k: " + k + "  v: " + v);
        });
        return "hello:" + port;
    }

}
